package com.iocup.keybastion.authorize.parser;


import com.pine.sunflower.core.validate.Validator;
import lombok.Getter;

import java.lang.annotation.Annotation;

/**
 * @author xyjxust
 * @create 2022/3/3 9:34
 **/
@Getter
public class AuthAnnoObject {

    private Class<? extends Annotation> annClass;
    private AnnotationElementParser elementParser;

    public AuthAnnoObject(Class<? extends Annotation> annClass, AnnotationElementParser elementParser) {
        Validator.build().validate(annClass == null, "解析注解不能为空")
                .validate(elementParser == null, "注解解析器不能为空")
                .throwIfFail();
        this.annClass = annClass;
        this.elementParser = elementParser;
    }
}
